#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QAction>
#include <QCloseEvent>
#include "stlwidget.h"

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

protected:
    void closeEvent(QCloseEvent *event);

private:
    void readSettings();
    void writeSettings();
    void initActions();
    void initMenuBar();
    void initToolBar();
    void initStatusBar();
    void initCentralWidget();
    void loadFile(const QString &filePath);

protected slots:
    void showOpenFile();
    void showAbout();
    void showOption();
    void langEn();
    void langZh();
    void generateGcode();

private:
    QAction *openAct;
    QAction *quitAct;
    QAction *enAct;
    QAction *zhAct;
    QAction *optionAct;
    QAction *aboutAct;
    QAction *generateAct;

    StlWidget *stlWidget;

signals:

public slots:
    // 处理线程执行的结果
    void handleResults(int rslt);
};

#endif // MAINWINDOW_H
